package ru.bragnikita.utils.logexplorer.model;

import com.google.common.collect.Lists;

import java.io.File;
import java.util.Collection;
import java.util.List;

/**
 * @author Nikita.Brazhnikov
 */
public class FilesSet {
	private List<FsItem> items;

	public FilesSet(Collection<File> items) {
		List<FsItem> temp = Lists.newLinkedList();
		for (File file : items) {
			FsItem fsItem = new FsItem(file);
			fsItem.setName(file.getName());
			fsItem.setDirectory(file.isDirectory());
			fsItem.setAbsolutePath(file.getAbsolutePath());
			temp.add(fsItem);
		}
		this.items = Lists.newArrayListWithExpectedSize(temp.size());
		for (FsItem item : temp) {
			this.items.add(item);
		}
	}

	public List<FsItem> getItems() {
		return items;
	}

}
